package cn.gjxblog.proxy.base.cglib;

import cn.gjxblog.proxy.base.HelloworldImpl;
import org.springframework.cglib.proxy.Enhancer;

/**
 * TODO...
 *
 * @Author guojiaxun
 * @Date 2019/12/30 10:38
 */
public class Demo {

	public static void main(String[] args) {
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(HelloworldImpl.class);
		enhancer.setCallback(new MyMethodInterceptor());

		HelloworldImpl helloworld = (HelloworldImpl) enhancer.create();
		helloworld.sayHello();

	}
}
